
[dbo].[InventoryTransactionLogLine]
CREATE TABLE [dbo].[InventoryTransactionLogLine]
(
[InventoryTransactionLogKey] [uniqueidentifier] NOT NULL,
[InventoryTransactionLogLineKey] [uniqueidentifier] NOT NULL,
[TransactionTypeCode] [int] NOT NULL,
[WarehouseKey] [uniqueidentifier] NOT NULL,
[OrderLineKey] [uniqueidentifier] NULL,
[ProductKey] [uniqueidentifier] NOT NULL,
[UomKey] [uniqueidentifier] NOT NULL,
[ProductDescription] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Quantity] [decimal] (18, 8) NOT NULL,
[QuantityOrdered] [decimal] (18, 8) NULL,
[ReasonCodeKey] [uniqueidentifier] NULL,
[LotId] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PurchaseOrderNumber] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[InventoryLocationKey] [uniqueidentifier] NULL,
[LandedCost] [decimal] (18, 4) NULL,
[OrderFulfillmentLineKey] [uniqueidentifier] NULL,
[ProductInventoryKey] [uniqueidentifier] NULL,
[TransactionMessage] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SortOrder] [int] NOT NULL,
[RelatedInventoryTransactionLogLineKey] [uniqueidentifier] NULL,
[TotalCost] [decimal] (18, 4) NULL,
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InventoryTransactionLogLine] ADD CONSTRAINT [PK_InventoryTransactionLogLine] PRIMARY KEY CLUSTERED ([InventoryTransactionLogLineKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InventoryTransactionLogLine_InventoryTransactionLogKey] ON [dbo].[InventoryTransactionLogLine] ([InventoryTransactionLogKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InventoryTransactionLogLine_OrderLineKey] ON [dbo].[InventoryTransactionLogLine] ([OrderLineKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InventoryTransactionLogLine_ProductKey] ON [dbo].[InventoryTransactionLogLine] ([ProductKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InventoryTransactionLogLine] ADD CONSTRAINT [FK_InventoryTransactionLogLine_TransactionTypeRef] FOREIGN KEY ([TransactionTypeCode]) REFERENCES [dbo].[TransactionTypeRef] ([TransactionTypeCode])
GO